import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Share from '../views/Share.vue'
import Unknown from '../views/Unknown.vue'
import Detail from '../views/Detail.vue'
import Search from '../views/Search'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  }, {
    path: '/share',
    name: 'Share',
    component: Share,
  }, {
    path: '/unknown',
    name: 'Unknown',
    component: Unknown,
  }, {
    path: '/detail/:pk',
    name: 'Detail',
    component: Detail
  }, {
    path: '/search',
    name: 'Search',
    component: Search
  },];


// 配置路由,配置完成后需添加到main.js中
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
export default router
